﻿
--##
delete from [core_site]
delete from [core_sitetemplate]
delete from [core_user]
delete from [core_privilege]
delete from [core_moduleview]
delete from [core_module]
delete from [core_codecategory]
delete from [core_codedefinition]
delete from [core_nav]
delete from [core_page]
delete from [core_sitehost]
delete from [core_role]
delete from [core_shortcut]

insert into [core_user] ([Id],[Account],[Name],[Email],[CreatedTime],[Prefix],[Password]) values ('{93AFC241-3751-46D1-9252-527FF9FDF60D}','admin','admin','admin@ss.com',getdate(),null,'');
insert into [core_user] ([Id],[Account],[Name],[Email],[CreatedTime],[Prefix],[Password]) values ('{E20DCD75-6DAA-457B-B2FD-F108D02F2EFB}','jeadong','jeadong','jeadong@ss.com',getdate(),null,'');
insert into [core_user] ([Id],[Account],[Name],[Email],[CreatedTime],[Prefix],[Password]) values ('{14876FAB-CB92-4B6C-ADAD-5E42CF466371}','flash','flash','flash@ss.com',getdate(),null,'');
insert into [core_sitetemplate] ([Id],[Code],[Caption]) 
	values ('{26A1073A-FB61-4E7E-A939-3A59B4B1209D}','Prototype','Prototype');
insert into [core_site] (
	[id],
	[Name],
	[ShortName],
	[ImageId],
	[IsActive],
	[SortIndex],
	[TemplateId],
	[Type],
	[Copyright],
	[IsAllowAnonymous],
	[AnonymousUserId],
	[AdminUserId],
	[DefaultPageId])
	values (
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	'测试系统','测试系统',null,'1','1','{26A1073A-FB61-4E7E-A939-3A59B4B1209D}','webform','copyright','0',null,'{93AFC241-3751-46D1-9252-527FF9FDF60D}',
	'{A67E15D2-8D5E-40C2-9562-9ED35821575E}')
insert into [core_sitehost] ([id],[siteid],[host],[isenable]) 
	values (
	'{B20CE98C-1939-4107-B002-9A22492EC859}',
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	'http://localhost:9487/',
	'1')

insert into [core_module] (
	[Id],
	[Code],
	[Name],
	[Type])
	values (
	'{A9A680B8-23B3-45B5-ADD7-B863436FCB77}',
	'Workflow',
	'Workflow',
	'webform');
insert into [core_moduleview](
	[Id],
	[Code],
	[Caption],
	[ModuleId])
	values(
	'{5EC7046F-9E5C-4367-8078-A965CD4E0D88}',
	'~/Modules/Workflow/Parts/TaskListPart.ascx',
	'任务列表',
	'{A9A680B8-23B3-45B5-ADD7-B863436FCB77}');
-- 请假类型
insert into [core_codecategory](
	[Id],
	[Code],
	[Caption]) 
	values (
	'{6DC45627-5BAA-4F0E-B071-B311A6AD6CCE}',
	'OA.LEAVETYPE',
	'请假类型定义');
insert into [core_codedefinition](
	[Id],
	[Code],
	[Caption],
	[CategoryId])
	values (
	'{842159E5-88DE-4549-9C0F-3688C5BE9C10}',
	'OA.LEAVETYPE.SICK',
	'病假',
	'{6DC45627-5BAA-4F0E-B071-B311A6AD6CCE}');
insert into [core_codedefinition](
	[Id],
	[Code],
	[Caption],
	[CategoryId])
	values (
	'{3A22D2A5-4CB3-4B8D-B1B4-3890AE1A2337}',
	'OA.LEAVETYPE.PERSONAL',
	'事假',
	'{6DC45627-5BAA-4F0E-B071-B311A6AD6CCE}');
insert into [core_codedefinition](
	[Id],
	[Code],
	[Caption],
	[CategoryId])
	values (
	'{8CB74C79-6032-4E51-86BE-9DD7B0681E04}',
	'OA.LEAVETYPE.MARITAL',
	'婚假',
	'{6DC45627-5BAA-4F0E-B071-B311A6AD6CCE}');
insert into [core_codedefinition](
	[Id],
	[Code],
	[Caption],
	[CategoryId])
	values (
	'{D5B35865-B731-4BB8-8598-08A60322788C}',
	'OA.LEAVETYPE.MATERNITY',
	'产假',
	'{6DC45627-5BAA-4F0E-B071-B311A6AD6CCE}');
insert into [core_codedefinition](
	[Id],
	[Code],
	[Caption],
	[CategoryId])
	values (
	'{ACE59336-93CA-481B-91CC-28DE07EFA096}',
	'OA.LEAVETYPE.FUNERAL',
	'丧假',
	'{6DC45627-5BAA-4F0E-B071-B311A6AD6CCE}');
-- 文章类别
insert into [core_codecategory](
	[Id],
	[Code],
	[Caption]) 
	values (
	'{22998230-3D00-488F-9A04-59C8A4527D68}',
	'ARTICLETYPE',
	'文章类型定义');
insert into [core_codedefinition](
	[Id],
	[Code],
	[Caption],
	[CategoryId])
	values (
	'{DCDC2BF6-D1EB-4CEC-AF38-B1E75B278858}',
	'ARTICLETYPE.NOTICE',
	'通知',
	'{22998230-3D00-488F-9A04-59C8A4527D68}');
insert into [core_codedefinition](
	[Id],
	[Code],
	[Caption],
	[CategoryId])
	values (
	'{11E5FB4F-52D7-40C0-8F3D-1281FD30D4C2}',
	'ARTICLETYPE.NEWS',
	'新闻',
	'{22998230-3D00-488F-9A04-59C8A4527D68}');
-- 资产类型
insert into [core_codecategory](
	[Id],
	[Code],
	[Caption]) 
	values (
	'{673DEFCE-37CF-422B-A656-428DDCC6652E}',
	'ASSETTYPE',
	'资产类型定义');
insert into [core_codedefinition](
	[Id],
	[Code],
	[Caption],
	[CategoryId])
	values (
	'{FFB5FF49-4675-4A8D-BDB4-528E35A92F4E}',
	'ASSETTYPE.DESK',
	'桌子',
	'{673DEFCE-37CF-422B-A656-428DDCC6652E}');
insert into [core_codedefinition](
	[Id],
	[Code],
	[Caption],
	[CategoryId])
	values (
	'{3F9CC896-1773-4D61-9DBE-CDBA241F86AD}',
	'ASSETTYPE.COMPUTER',
	'电脑',
	'{673DEFCE-37CF-422B-A656-428DDCC6652E}');

-- ## 导航
insert into [core_nav](
	[Id],
	[Code],
	[SiteId],
	[PageId],
	[ImageId],
	[Caption],
	[Description],
	[TargetType],
	[TargetId],
	[Url],
	[Arguments],
	[ContainerCode],
	[SortIndex])
	values (
	'{19819EDC-1D50-46D6-BBAC-2FFD0BA0FC9F}',
	'Nav_Root1',
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	null,
	null,
	'系统管理',
	'系统管理',
	null,
	null,
	null,
	'',
	'',
	1);
insert into [core_nav](
	[Id],
	[Code],
	[SiteId],
	[PageId],
	[ImageId],
	[Caption],
	[Description],
	[TargetType],
	[TargetId],
	[Url],
	[Arguments],
	[ContainerCode],
	[SortIndex])
	values (
	'{B3BC661C-354A-4996-9098-A86242C2A835}',
	'Nav_Root2',
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	null,
	null,
	'测试功能',
	'测试功能',
	null,
	null,
	null,
	'',
	'',
	1);
insert into [core_nav](
	[Id],
	[Code],
	[ParentId],
	[SiteId],
	[PageId],
	[ImageId],
	[Caption],
	[Description],
	[TargetType],
	[TargetId],
	[Url],
	[Arguments],
	[ContainerCode],
	[SortIndex])
	values (
	'{8A4F66BA-6DBF-4F2A-A854-64A32F2DEDC5}',
	'Nav_Folder1',
	'{19819EDC-1D50-46D6-BBAC-2FFD0BA0FC9F}',
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	null,
	null,
	'基础数据管理',
	'基础数据管理',
	null,
	null,
	null,
	'',
	'',
	1);
insert into [core_nav](
	[Id],
	[ParentId],
	[Code],
	[SiteId],
	[PageId],
	[ImageId],
	[Caption],
	[Description],
	[TargetType],
	[TargetId],
	[Url],
	[Arguments],
	[ContainerCode],
	[SortIndex])
	values (
	'{B39A5F84-4A58-4AE1-A745-CBF0D438CECD}',
	'{19819EDC-1D50-46D6-BBAC-2FFD0BA0FC9F}',
	'Navigation_Page1',
	'{19819EDC-1D50-46D6-BBAC-2FFD0BA0FC9F}',
	null,
	null,
	'组织结构管理',
	'组织结构管理',
	'PAGE',
	'{A75B746B-6B92-4EDF-96B7-25BB2542A9D4}',
	'~/Modules/Orgs/Pages/OrgTree.aspx',
	'',
	'',
	1);
insert into [core_nav](
	[Id],
	[Code],
	[ParentId],
	[SiteId],
	[PageId],
	[ImageId],
	[Caption],
	[Description],
	[TargetType],
	[TargetId],
	[Url],
	[Arguments],
	[ContainerCode],
	[SortIndex])
	values (
	'{4198D520-72B2-41AC-8D63-C68253DC9FFE}',
	'Navigation_Page2',
	'{B3BC661C-354A-4996-9098-A86242C2A835}',
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	null,
	null,
	'我的请假单',
	'我的请假单',
	'PAGE',
	'{34188D2C-708F-492E-9F80-17339FEE1B5A}',
	'~/Modules/OA/Pages/LeaveRequest-List.aspx',
	'',
	'',
	1);
insert into [core_nav](
	[Id],
	[Code],
	[ParentId],
	[SiteId],
	[PageId],
	[ImageId],
	[Caption],
	[Description],
	[TargetType],
	[TargetId],
	[Url],
	[Arguments],
	[ContainerCode],
	[SortIndex])
	values (
	'{D716B369-FC13-402D-A41F-DBF144FCD9AC}',
	'Navigation_Page3',
	'{B3BC661C-354A-4996-9098-A86242C2A835}',
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	null,
	null,
	'编码管理',
	'编码管理',
	'PAGE',
	'{335B260A-5C9F-42AB-A718-F37CFC9C7A9D}',
	'~/Modules/Core/Pages/CodeDefinition-List.aspx',
	'',
	'',
	3);
insert into [core_nav](
	[Id],
	[Code],
	[ParentId],
	[SiteId],
	[PageId],
	[ImageId],
	[Caption],
	[Description],
	[TargetType],
	[TargetId],
	[Url],
	[Arguments],
	[ContainerCode],
	[SortIndex])
	values (
	'{06B36CF1-C693-499D-9ED3-CCC242047097}',
	'Navigation_Page4',
	'{B3BC661C-354A-4996-9098-A86242C2A835}',
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	null,
	null,
	'我的任务',
	'我的任务',
	'PAGE',
	'{A5CBD577-4198-474D-9D9B-F2A6443EA210}',
	'~/Modules/Workflow/Pages/Task-List.aspx',
	'',
	'',
	3);
insert into [core_nav](
	[Id],
	[Code],
	[ParentId],
	[SiteId],
	[PageId],
	[ImageId],
	[Caption],
	[Description],
	[TargetType],
	[TargetId],
	[Url],
	[Arguments],
	[ContainerCode],
	[SortIndex])
	values (
	'{9EDEC47C-DFC6-4FEF-81F7-E7FD365A0439}',
	'Navigation_Page5',
	'{B3BC661C-354A-4996-9098-A86242C2A835}',
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	null,
	null,
	'组织结构类型维护',
	'组织结构类型维护页面',
	'PAGE',
	'{E60D89AC-E207-4BC9-AF91-A73E752E7901}',
	'~/Modules/Orgs/Pages/NodeType-List.aspx',
	'',
	'',
	1);
insert into [core_nav](
	[Id],
	[Code],
	[ParentId],
	[SiteId],
	[PageId],
	[ImageId],
	[Caption],
	[Description],
	[TargetType],
	[TargetId],
	[Url],
	[Arguments],
	[ContainerCode],
	[SortIndex])
	values (
	'{C51EDEDB-57D1-4BF5-A319-1757BD311C97}',
	'Navigation_Page6',
	'{B3BC661C-354A-4996-9098-A86242C2A835}',
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	null,
	null,
	'文档列表',
	'文档列表',
	'PAGE',
	'{C51EDEDB-57D1-4BF5-A319-1757BD311C97}',
	'~/Modules/OA/Pages/DocItem-List.aspx',
	'',
	'',
	3);
insert into [core_nav](
	[Id],
	[Code],
	[ParentId],
	[SiteId],
	[PageId],
	[ImageId],
	[Caption],
	[Description],
	[TargetType],
	[TargetId],
	[Url],
	[Arguments],
	[ContainerCode],
	[SortIndex])
	values (
	'{11B0A2EF-7C24-459D-9E15-ADEF2FD88F84}',
	'Navigation_Page6',
	'{B3BC661C-354A-4996-9098-A86242C2A835}',
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	null,
	null,
	'资产列表',
	'资产列表',
	'PAGE',
	'{17C00908-8AE9-479A-8BA8-4D24CA67508A}',
	'~/Modules/OA/Pages/Asset-List.aspx',
	'',
	'',
	3);
insert into [core_nav](
	[Id],
	[Code],
	[ParentId],
	[SiteId],
	[PageId],
	[ImageId],
	[Caption],
	[Description],
	[TargetType],
	[TargetId],
	[Url],
	[Arguments],
	[ContainerCode],
	[SortIndex])
	values (
	'{E1DD2E4E-6E6A-4710-828E-A4D430862B80}',
	'Navigation_Page9',
	'{19819EDC-1D50-46D6-BBAC-2FFD0BA0FC9F}',
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	null,
	null,
	'人员列表',
	'人员列表',
	'PAGE',
	'{09D99DCA-4801-4CF9-97D4-18D7B1EE955A}',
	'~/Modules/Orgs/Pages/Employee-List.aspx',
	'',
	'',
	3);
insert into [core_nav](
	[Id],
	[Code],
	[ParentId],
	[SiteId],
	[PageId],
	[ImageId],
	[Caption],
	[Description],
	[TargetType],
	[TargetId],
	[Url],
	[Arguments],
	[ContainerCode],
	[SortIndex])
	values (
	'{328B4F19-5664-430F-876C-0DB3DA811081}',
	'Navigation_Page10',
	'{19819EDC-1D50-46D6-BBAC-2FFD0BA0FC9F}',
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	null,
	null,
	'文章列表',
	'文章列表',
	'PAGE',
	'{2B478317-6FCC-44AB-B29E-7277A2AE7D93}',
	'~/Modules/OA/Pages/Article-List.aspx',
	'',
	'',
	3);
insert into [core_nav](
	[Id],
	[Code],
	[ParentId],
	[SiteId],
	[PageId],
	[ImageId],
	[Caption],
	[Description],
	[TargetType],
	[TargetId],
	[Url],
	[Arguments],
	[ContainerCode],
	[SortIndex])
	values (
	'{F86860F4-84FC-4EFC-BE70-0F2D675B6E3F}',
	'Navigation_Page11',
	'{19819EDC-1D50-46D6-BBAC-2FFD0BA0FC9F}',
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	null,
	null,
	'工作日志列表',
	'工作日志列表',
	'PAGE',
	'{87560BFB-BBFE-4CE6-8E1C-67F2FDDCA464}',
	'~/Modules/OA/Pages/WorkLog-List.aspx',
	'',
	'',
	3);
-- ## 快捷方式
insert into [core_shortcut](
	[Id],
	[SiteId],
	[Caption],
	[ImageId],
	[Url],
	[RefType],
	[RefId],
	[SortIndex]
) values (
	'{E747A869-6B59-4868-BC2E-2EE9DC736C61}',
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	'首页',
	null,
	'~/Modules/Common/Pages/Home.aspx',
	'PAGE',
	'{A67E15D2-8D5E-40C2-9562-9ED35821575E}',
	1
);
-- ## 页面
insert into [core_page](
	[Id],
	[SiteId],
	[Code],
	[Caption],
	[TemplateId],
	[Type],
	[Url],
	[IsInheritedSiteNavigation])
	values(
	'{A75B746B-6B92-4EDF-96B7-25BB2542A9D4}',
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	'Page1',
	'组织结构管理页面',
	null,
	'NATIVE',
	'~/Modules/Orgs/Pages/OrgTree.aspx',
	0);
insert into [core_page](
	[Id],
	[SiteId],
	[Code],
	[Caption],
	[TemplateId],
	[Type],
	[Url],
	[IsInheritedSiteNavigation])
	values(
	'{34188D2C-708F-492E-9F80-17339FEE1B5A}',
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	'Page2',
	'我的请假单页面',
	null,
	'NATIVE',
	'~/Modules/OA/Pages/LeaveRequest-List.aspx',
	0);
insert into [core_page](
	[Id],
	[SiteId],
	[Code],
	[Caption],
	[TemplateId],
	[Type],
	[Url],
	[IsInheritedSiteNavigation])
	values(
	'{335B260A-5C9F-42AB-A718-F37CFC9C7A9D}',
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	'Page3',
	'编码管理页面',
	null,
	'NATIVE',
	'~/Modules/Core/Pages/CodeDefinition-List.aspx',
	0);
insert into [core_page](
	[Id],
	[SiteId],
	[Code],
	[Caption],
	[TemplateId],
	[Type],
	[Url],
	[IsInheritedSiteNavigation])
	values(
	'{A5CBD577-4198-474D-9D9B-F2A6443EA210}',
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	'Page4',
	'流程任务列表页面',
	null,
	'NATIVE',
	'~/Modules/Workflow/Pages/Task-List.aspx',
	0);
insert into [core_page](
	[Id],
	[SiteId],
	[Code],
	[Caption],
	[TemplateId],
	[Type],
	[Url],
	[IsInheritedSiteNavigation])
	values(
	'{E60D89AC-E207-4BC9-AF91-A73E752E7901}',
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	'Page5',
	'组织结构类型维护页面',
	null,
	'NATIVE',
	'~/Modules/Orgs/Pages/NodeTypeList.aspx',
	0);
insert into [core_page](
	[Id],
	[SiteId],
	[Code],
	[Caption],
	[TemplateId],
	[Type],
	[Url],
	[IsInheritedSiteNavigation])
	values(
	'{7E6F054B-DE39-4031-884E-2E5200352C4A}',
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	'Page6',
	'文档列表',
	null,
	'NATIVE',
	'~/Modules/OA/Pages/DocItem-List.aspx',
	0);
insert into [core_page](
	[Id],
	[SiteId],
	[Code],
	[Caption],
	[TemplateId],
	[Type],
	[Url],
	[IsInheritedSiteNavigation])
	values(
	'{A67E15D2-8D5E-40C2-9562-9ED35821575E}',
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	'Page7',
	'首页',
	null,
	'NATIVE',
	'~/Modules/Common/Pages/Home.aspx',
	0);
insert into [core_page](
	[Id],
	[SiteId],
	[Code],
	[Caption],
	[TemplateId],
	[Type],
	[Url],
	[IsInheritedSiteNavigation])
	values(
	'{17C00908-8AE9-479A-8BA8-4D24CA67508A}',
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	'Page8',
	'资产列表',
	null,
	'NATIVE',
	'~/Modules/OA/Pages/Asset-List.aspx',
	0);
insert into [core_page](
	[Id],
	[SiteId],
	[Code],
	[Caption],
	[TemplateId],
	[Type],
	[Url],
	[IsInheritedSiteNavigation])
	values(
	'{09D99DCA-4801-4CF9-97D4-18D7B1EE955A}',
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	'Page9',
	'人员管理',
	null,
	'NATIVE',
	'~/Modules/Orgs/Pages/Employee-List.aspx',
	0);
insert into [core_page](
	[Id],
	[SiteId],
	[Code],
	[Caption],
	[TemplateId],
	[Type],
	[Url],
	[IsInheritedSiteNavigation])
	values(
	'{2B478317-6FCC-44AB-B29E-7277A2AE7D93}',
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	'Page10',
	'文章管理',
	null,
	'NATIVE',
	'~/Modules/OA/Pages/Article-List.aspx',
	0);
insert into [core_page](
	[Id],
	[SiteId],
	[Code],
	[Caption],
	[TemplateId],
	[Type],
	[Url],
	[IsInheritedSiteNavigation])
	values(
	'{87560BFB-BBFE-4CE6-8E1C-67F2FDDCA464}',
	'{F938A44A-96ED-4592-9DE6-299B1037FA8D}',
	'Page11',
	'工作日志管理',
	null,
	'NATIVE',
	'~/Modules/OA/Pages/WorkLog-List.aspx',
	0);

-- ## 组织结构
delete from [orgs_node]
delete from [orgs_nodetype]
delete from [orgs_typerelation]

insert into [orgs_nodetype](
	[Id],
	[Code],
	[Caption],
	[IsPost])
	values (
	'{D189EF33-2958-4232-816B-3EDBD9816830}',
	'ORG.GROUP',
	'集团',
	0);
insert into [orgs_nodetype](
	[Id],
	[Code],
	[Caption],
	[IsPost])
	values (
	'{4414BBF7-E284-409C-AC32-58AD8297E918}',
	'ORG.COMPANY',
	'公司',
	0);
insert into [orgs_nodetype](
	[Id],
	[Code],
	[Caption],
	[IsPost])
	values (
	'{9AE37EF3-1E85-43FC-89CD-E82DD5F3E3F0}',
	'ORG.DEPARTMENT',
	'部门',
	0);
insert into [orgs_nodetype](
	[Id],
	[Code],
	[Caption],
	[IsPost])
	values (
	'{307F97BF-55DD-41B3-84B7-E39F50616EE1}',
	'ORG.POST',
	'岗位',
	1);
insert into [orgs_typerelation](
	[Id],
	[ParentTypeId],
	[SubTypeId])
	values (
	'{173E1264-AFFE-46E2-A293-1DA22FC8D101}',
	'{D189EF33-2958-4232-816B-3EDBD9816830}',
	'{4414BBF7-E284-409C-AC32-58AD8297E918}');
insert into [orgs_typerelation](
	[Id],
	[ParentTypeId],
	[SubTypeId])
	values (
	'{4FDB5D2C-C9E6-45D9-833A-35698A9B72C9}',
	'{4414BBF7-E284-409C-AC32-58AD8297E918}',
	'{4414BBF7-E284-409C-AC32-58AD8297E918}');
insert into [orgs_typerelation](
	[Id],
	[ParentTypeId],
	[SubTypeId])
	values (
	'{191B6F80-5BC1-4963-86A0-9EB081F4958B}',
	'{4414BBF7-E284-409C-AC32-58AD8297E918}',
	'{9AE37EF3-1E85-43FC-89CD-E82DD5F3E3F0}');
insert into [orgs_typerelation](
	[Id],
	[ParentTypeId],
	[SubTypeId])
	values (
	'{D7A1855E-C71E-4171-9602-9CCDD5F7B0D5}',
	'{9AE37EF3-1E85-43FC-89CD-E82DD5F3E3F0}',
	'{9AE37EF3-1E85-43FC-89CD-E82DD5F3E3F0}');
insert into [orgs_typerelation](
	[Id],
	[ParentTypeId],
	[SubTypeId])
	values (
	'{EDD50FEB-E281-4C15-9B64-C4B36B467871}',
	'{9AE37EF3-1E85-43FC-89CD-E82DD5F3E3F0}',
	'{307F97BF-55DD-41B3-84B7-E39F50616EE1}');
insert into [orgs_node](
	[Id],
	[Code],
	[Name],
	[TypeId],
	[ParentId],
	[SortIndex]
)values(
	'{B91ACC7A-B376-4E22-B64C-BC41096ABCD1}',
	'1000',
	'集团公司',
	'{D189EF33-2958-4232-816B-3EDBD9816830}',
	null,
	0);
insert into [orgs_node](
	[Id],
	[Code],
	[Name],
	[TypeId],
	[ParentId],
	[SortIndex]
)values(
	'{5E75FF3D-CAC9-4712-8DDF-F6406272D790}',
	'01',
	'北京分公司',
	'{4414BBF7-E284-409C-AC32-58AD8297E918}',
	'{B91ACC7A-B376-4E22-B64C-BC41096ABCD1}',
	1);
insert into [orgs_node](
	[Id],
	[Code],
	[Name],
	[TypeId],
	[ParentId],
	[SortIndex]
)values(
	'{11A2633F-EA4D-4EAD-9B96-3898B98633E6}',
	'01',
	'研发部',
	'{9AE37EF3-1E85-43FC-89CD-E82DD5F3E3F0}',
	'{5E75FF3D-CAC9-4712-8DDF-F6406272D790}',
	1);
insert into [orgs_node](
	[Id],
	[Code],
	[Name],
	[TypeId],
	[ParentId],
	[SortIndex]
)values(
	'{ADEC2C23-FB92-4E5E-825F-B0AF043E4AEB}',
	'02',
	'销售部',
	'{9AE37EF3-1E85-43FC-89CD-E82DD5F3E3F0}',
	'{5E75FF3D-CAC9-4712-8DDF-F6406272D790}',
	2);
insert into [orgs_node](
	[Id],
	[Code],
	[Name],
	[TypeId],
	[ParentId],
	[SortIndex]
)values(
	'{076DDC83-391D-4033-9207-51DB44EC4A85}',
	'02',
	'武汉分公司',
	'{4414BBF7-E284-409C-AC32-58AD8297E918}',
	'{B91ACC7A-B376-4E22-B64C-BC41096ABCD1}',
	2);

-- ## 流程
delete from wf_workflow;
delete from wf_activity;
delete from wf_event;

insert into wf_event (Id,Code,WorkflowId,FromActivityId,ToActivityId,Caption,IsNeedPickUser,IsNeedInputComment) values ('{B096B67F-A781-4D86-99AC-3980F5647814}','OA.LEAVE.EVENT.SEND','{CA56576B-4998-4923-A532-FF63AE2639BD}','{DDD768B0-82EB-4BE5-83B0-BB51C7983815}','{E284E13E-885B-4FDC-B462-BBC551EC7964}','提交',1,0);
insert into wf_event (Id,Code,WorkflowId,FromActivityId,ToActivityId,Caption,IsNeedPickUser,IsNeedInputComment) values ('{2EBC68C3-19BC-4A54-9E93-5E9C5855AF5D}','OA.LEAVE.EVENT.REJECT','{CA56576B-4998-4923-A532-FF63AE2639BD}','{E284E13E-885B-4FDC-B462-BBC551EC7964}','{F3FBCB17-D861-4BBD-952D-3C3E25AD587C}','否决',0,1);
insert into wf_event (Id,Code,WorkflowId,FromActivityId,ToActivityId,Caption,IsNeedPickUser,IsNeedInputComment) values ('{825AB842-1826-4571-B4AF-7A79ED2FF9EB}','OA.LEAVE.EVENT.APPROVE','{CA56576B-4998-4923-A532-FF63AE2639BD}','{E284E13E-885B-4FDC-B462-BBC551EC7964}','{B005AC75-3DB5-42A5-B30B-5DFED8689D7A}','同意',0,1);

-- ##
insert into wf_workflow (id,code,caption,[RefModule]) values ('{CA56576B-4998-4923-A532-FF63AE2639BD}','WF.OA.LEAVE','请假流程','OA.LEAVE');

insert into wf_activity (Id,Code,WorkflowId,Caption,IsInitial) values ('{DDD768B0-82EB-4BE5-83B0-BB51C7983815}','WF.OA.LEAVE.DRAFT','{CA56576B-4998-4923-A532-FF63AE2639BD}','起草',1);
insert into wf_activity (Id,Code,WorkflowId,Caption,IsInitial) values ('{E284E13E-885B-4FDC-B462-BBC551EC7964}','WF.OA.LEAVE.AUDIT','{CA56576B-4998-4923-A532-FF63AE2639BD}','等待审核',0);
insert into wf_activity (Id,Code,WorkflowId,Caption,IsInitial) values ('{F3FBCB17-D861-4BBD-952D-3C3E25AD587C}','WF.OA.LEAVE.REJECT','{CA56576B-4998-4923-A532-FF63AE2639BD}','审核不通过',0);
insert into wf_activity (Id,Code,WorkflowId,Caption,IsInitial) values ('{B005AC75-3DB5-42A5-B30B-5DFED8689D7A}','WF.OA.LEAVE.APPROVE','{CA56576B-4998-4923-A532-FF63AE2639BD}','审核通过',0);
-- ## 权限
insert into [core_privilege] ([Id],[Code],[Caption],[SiteId],[Type],[RefId],[RefModule],[Description]) 
	values ('{B891993D-609D-422F-BA6B-6BB25BC74C27}','PRIVILEGE.OA.LEAVE.AUDIT','请假流程审核权限','{F938A44A-96ED-4592-9DE6-299B1037FA8D}','RESOURCE','{E284E13E-885B-4FDC-B462-BBC551EC7964}','OA.LEAVE','请假流程审核权限');
insert into core_role ([Id],[Code],[RefModule],[RefId],[Type],[Caption],[CreatedTime]) values ('{C4D71522-2EC1-4094-8FFF-23B973D75BEF}','OA.LEAVE.AUDITOR','OA.LEAVE','{E284E13E-885B-4FDC-B462-BBC551EC7964}','ROLE.ROOT','请假流程审核人',getdate());
